<?php
/**
 * @Copyright Copyright (C) 2010-2012
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 + Created by:          Webit Solution
 * Company:		Webit Solution
 + Contact:		www.webits.asia, developer@webits.asia
 * Created on:	Mar 21, 2012
 ^
 + Project: 		WRecruit
 * File Name:	views/employer/tmpl/formjob.php
 ^ 
 * Description: template for form job
 ^ 
 * History:		NONE
 ^ 
 */
 

defined('_JEXEC') or die('Restricted access');

 global $mainframe;
$document =& JFactory::getDocument();

//$document->addScript( 'components/com_wrecruit/js/jquery-1.7.2.min.js' );
//$document->addScript( 'components/com_wrecruit/js/jquery-ui.min.js' );
//$document->addScript( 'components/com_wrecruit/js/jquery.uniform.js' );
//$document->addScript( 'components/com_wrecruit/js/scripts.js' );
$document->addScript( 'components/com_wrecruit/js/emppopup.js' );
$document->addStyleSheet('components/com_wrecruit/css/emppopup.css');
$document->addStyleSheet('components/com_wrecruit/css/other_employers.css');
$model = $this->getModel('wrecruit', 'WRecruitModel');
 
//add multi select 
$document->addStyleSheet('components/com_wrecruit/css/chosen/chosen.css');
//end
 
jimport('joomla.html.pane');

$editor = & JFactory :: getEditor();
JHTML :: _('behavior.calendar');

    $document = &JFactory::getDocument();
    $document->addStyleSheet('components/com_wrecruit/css/'.$this->config['theme']);
	$version = new JVersion;
	$joomla = $version->getShortVersion();
	$jversion = substr($joomla,0,3);

	$dateformat = $this->config['date_format'];
	$firstdash = strpos($dateformat,'-',0);
	$firstvalue = substr($dateformat, 0,$firstdash);
	$firstdash = $firstdash + 1;
	$seconddash = strpos($dateformat,'-',$firstdash);
	$secondvalue = substr($dateformat, $firstdash,$seconddash-$firstdash);
	$seconddash = $seconddash + 1;
	$thirdvalue = substr($dateformat, $seconddash,strlen($dateformat)-$seconddash);
	$js_dateformat = '%'.$firstvalue.'-%'.$secondvalue.'-%'.$thirdvalue;
  
?>
<?php if ($this->config['offline'] == '1'){ ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" >
	<tr><td valign="top" class="<?php echo $this->theme['title']; ?>" >	<?php echo $this->config['title']; ?></td></tr>
	<tr><td height="25"></td></tr>
	<tr><td class="wrecruitmsg">
		<?php echo $this->config['offline_text']; ?>
	</td></tr>
</table>	
<?php }else{ ?>
<script language="javascript">
	function hideShowRange(hideSrc, showSrc, showName, showVal){
		document.getElementById(hideSrc).style.visibility = "hidden";
		document.getElementById(showSrc).style.visibility = "visible";
		document.getElementById(showName).value = showVal;
	
	}
 
	function myValidate(f) {
		var returnvalue = true;
		
	/*	if (f.id.value == ''){
			if (CheckDate()== false) returnvalue = false; 
		}*/		
		if (document.formvalidator.isValid(f)) {
                f.check.value='<?php echo JUtility::getToken(); ?>';//send token
        } else {
                alert('<?php echo JText::_( 'JS_SOME_VALUES_ARE_NOT_ACCEPTABLE_PLEASE_RETRY');?>');
				returnvalue = false;
        }
		if (returnvalue == true)
			return true;
		else{	
			return false;
		}	
}

function CheckDate() {
//alert('date');
	f = document.adminForm;
	var returnvalue = true;
	var today=new Date()
	if ((today.getMonth()+1) < 10)
		var tomonth = "0"+(today.getMonth()+1);
	else
		var tomonth = (today.getMonth()+1);
	
	if ((today.getDate()) < 10)
		var day = "0"+(today.getDate());
	else
		var day = (today.getDate());

		var todate = (today.getYear()+1900)+"-"+tomonth+"-"+day;
	
//alert(todate); 
		if(f.startpublishing.value != ""){
			if (todate > f.startpublishing.value ){
				alert('Please enter a valid start publishing date');
				f.startpublishing.value="";
				returnvalue = false;
			}
		}		
		if(f.startpublishing.value >= f.deadline.value){
			alert("Please enter a valid dateline");
			f.deadline.value="";
			returnvalue = false;
		}
		return returnvalue;
	
}

function isAdded(id) {
	if(document.getElementById(id).checked==true){
		document.getElementById(id).value = 1;
	}
	else{
		document.getElementById(id).value = 0;
	}
	
}
</script>
<?php
if ($this->userrole->rolefor == 1) { // employer
//if ($this->canaddnewjob == 1) { // add new job, in edit case always 1
?>
<div class="box-list-job">
	<div class="job-seeker-panel">
	<?php include 'left_panel.php';?>
	</div>
	<div class="job-seeker-right">
		<div class="head-title">
			<h2>Account upgrade</h2>
		</div>
        <form action="index.php" method="post" name="adminForm" id="adminForm" class="form-validate"  onSubmit="return myValidate(this);">
        <div class="job-listing">
            <div id="upgrade-account">
                <img alt="" src="http://localhost/ga_svn//wrecruitdata/photo/candidate_2475fd7a688684f271910811165f74f1_1.jpg" width="150" height="150"/>
            </div>
            <div class="upgrade-account-des">
                <h3 style="text-align:center;">Recruitment made easy & fast!</h3>
                <p>Get more from our CV database over 5000. Access, announce your vacancies and get instantly the right candidate.</p>
            
            </div>
            <div class="upgrade-account-wrap">
                <div id="upgrade-left">
                   <p class="p-first">With our premium account, you will get benefit from the following features:</p>
                   <p>- Find and match candidate to your vacancy by using our CV search tool</p>
                   <hr style="height:0px; border: 1px solid #fff; margin-left: -10px;"/>
                   <p>- See the full CV of candidate without requesting every time</p>
                   <hr style="height:0px; border: 1px solid #fff; margin-left: -10px;"/>
                   <p>- Top up your job vacancy to be more visible to every potential candidates</p>
                   <hr style="height:0px; border: 1px solid #fff; margin-left: -10px;"/>
                   <p>- Be able to have a pool for your potential candidates to whom you will be able to invite them to apply to your job vacancies</p>
                 
                </div>
                <div id="upgrade-right">                        
                    <p>Our pricing:</p>
                    <ul>
                        <li><input type="radio"  name="ch1" value=""/>Annual:<strong> US$ 25.99</strong>/month</li>
                        <li><input type="radio"  name="ch1" value=""/> Monthly: <strong>US$ 20.99</strong>/month</li>
                    </ul>
                    <div class="btn-action" style="text-align: left; margin: 0px 0px 20px; width: 147px;">
                        <div class="wrapp-btn">
                            <span class="btn-left"><span class="btn-right"><input type="submit" name="update_account" value="Upgrade now!" class="btn" id="upgrade_account" /> &nbsp;</span></span>
                       </div>
                     </div>
                    
                    <p>By clicking Upgrade now, the upgrade request will be sent to us and you will get an invoice for this purchase through your email</p>
                    
                </div>
                
                <p style="margin: 10px 0px 0px 0px; float:left; width:100%;"><a href="#" style="text-decoration:underline;">Payment Methods:</a></p>
            
            </div>
            </div>
            </form>
</div>
</div>
<?php 
/*} else{ // can not add new job
	echo "<strong><font color='red'>".JText::_('JS_JOB_LIMIT_EXCEED')." <a href='index.php?option=com_wrecruit&view=employer&layout=packages&Itemid=$this->Itemid'>".JText::_('JS_EMPLOYER_PACKAGES')."</a></font></strong>";
}*/
} else{ // not allowed job posting
	//Update by Vireak on 28/06/2012
	//Add frame to this warning and some styling
	//---------------------
	echo '<div class="box-list"><div class="head-title"><h2>Oop!</h2></div>';
	echo '<span class="wr_info"><p>'.JText::_('JS_YOU_ARE_NOT_ALLOWED_TO_VIEW').'</p>';
	echo '<p>This page is reserved for the authorized employers or recruiters only. </p></span>';
	echo '</div>';
	//---------------------
}
}//ol
?>

	 <!--popup content-->
        <div id="popupContainer" class="hidden" style="text-align:left;">
            ddfffsfs
        </div>
        <div id="overlayEffect">
        </div>
       <!--end popup content--> 

<!--  <script src="chosen/jquery-1.7.2.min.js" type="text/javascript"></script>-->
<script src="components/com_wrecruit/js/chosen/chosen.jquery.js" type="text/javascript"></script>
  <script type="text/javascript"> 
	  jQuery(".chzn-select").chosen(); 
	  jQuery(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
</script>